package cn.t222.ch04.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;

@ControllerAdvice
public class GlobalConfig {
    @InitBinder("b")
    public void init(WebDataBinder dataBinder) {
        dataBinder.setFieldDefaultPrefix("b.");
    }
    @InitBinder("a")
    public void init2(WebDataBinder dataBinder) {
        dataBinder.setFieldDefaultPrefix("a.");
    }

}
